From df117d7fe37890c4a9c6fb18f2011964c02bf9b2 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 6 Jul 2009 11:58:02 +0100 Subject: [PATCH] x86, hvm: fix get msix entry error There is a mistake to get the msix entry number. It should be divide instead of modulus. Signed-off-by: Yang Zhang Signed-off-by: Qing He --- xen/arch/x86/hvm/vmsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c index 37c1e5c14f..e6bc057dcd 100644 --- a/xen/arch/x86/hvm/vmsi.c +++ b/xen/arch/x86/hvm/vmsi.c @@ -290,7 +290,7 @@ static int msixtbl_write(struct vcpu *v, unsigned long address, goto out; entry = msixtbl_find_entry(v, address); - nr_entry = (address - entry->gtable) % PCI_MSIX_ENTRY_SIZE; + nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE; offset = address & (PCI_MSIX_ENTRY_SIZE - 1); if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET) -- 2.30.2